package jiali.test.zhifubao;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradePagePayRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanUtils {

    // 支付宝客户端对象
    @Bean
    public AlipayClient alipayClient() {
        return new DefaultAlipayClient(AppUtil.gatewayUrl, AppUtil.app_id, AppUtil.merchant_private_key,
                "json", AppUtil.charset, AppUtil.alipay_public_key, AppUtil.sign_type);
    }

    // 支付宝接口对象：支付信息的配置对象
    @Bean
    public AlipayTradePagePayRequest alipayTradePagePayRequest(){
        return new AlipayTradePagePayRequest();
    }
}
